package com.sharp.core.math;

import static com.sharp.core.math.Trig.*;

public class Transformations {

	private Transformations() {}
	

	
	public static Matrix translate(Vec3 v) {
		return translate(v.getX(), v.getY(), v.getZ());
	}
	
	public static Matrix translate(float x, float y, float z) {
		return new Matrix(new float[][] {
				{0, 0, 0, 0},
				{0, 0, 0, 0},
				{0, 0, 0, 0},
				{x, y, z, 1}
		});
	}
	
	public static Matrix rotateAboutX(float a) {
		return new Matrix(new float[][] {
				{1,	0, 			0, 			0},
				{0,	cos(a), 	sin(a), 	0},
				{0,	-sin(a), 	cos(a), 	0},
				{0,	0, 			0,			1}
		});
	}
	
	public static Matrix rotateAboutY(float a) {
		return new Matrix(new float[][] {
				{cos(a), 	0, 	-sin(a), 	0},
				{0, 		1, 	0,		 	0},
				{sin(a), 	0, 	cos(a), 	0},
				{0, 		0, 	0,			1}
		});
	}
	
	public static Matrix rotateAboutZ(float a) {
		return new Matrix(new float[][] {
				{cos(0), -sin(a), 	0, 		0},
				{sin(0), cos(a), 	0, 		0},
				{0, 	0,			1,		0},
				{0, 	0, 			0, 		1}
		});
	}
	
}
